// VisualStudioATL.h
// VisualStudioATLApp.h : main header file for the VisualStudioATL application
//
#pragma once
#include "Resource.h"       // main symbols

// CVisualStudioATLApp:
// See  for the implementation of this class
//

class CVisualStudioATLApp : public saf::CComFramework,
	public IDispEventImpl<2, CVisualStudioATLApp, &saf::DIID__IComFrameworkEvents, &saf::LIBID_ArtFrameLib, -1, -1>
{
public:
	CVisualStudioATLApp();
	saf::IMainFrame* GetMainFrame() { return m_pMainFrame; }

	int WinMain(int nShowCmd);

public: // com Event
	BEGIN_SINK_MAP(CVisualStudioATLApp)
		SINK_ENTRY_EX(/*nID =*/ 2, saf::DIID__IComFrameworkEvents, /*dispid =*/ ID_ComFramework_CloseMainFrame, &OnCloseMainFrame)
		SINK_ENTRY_EX(/*nID =*/ 2, saf::DIID__IComFrameworkEvents, /*dispid =*/ ID_ComFramework_Quit, &OnQuit)
		SINK_ENTRY_EX(/*nID =*/ 2, saf::DIID__IComFrameworkEvents, /*dispid =*/ ID_ComFramework_PopupMenu, &OnPopupMenu)
	END_SINK_MAP()

	void __stdcall OnQuit(VARIANT_BOOL* bExit);
	void __stdcall OnCloseMainFrame(BSTR strKind, saf::IMainFrame* pMainFrame, VARIANT_BOOL *bExit);
	void __stdcall OnPopupMenu(BSTR strKind, saf::IPopupMenuBar* pPopupMenuBar, IDispatch* pKindObject);

protected:
	HRESULT CreateMDISplitterWnd(int nShowCmd);
	void CreateStatusBar();
	void CreateTools();
private:
	CComPtr<saf::IMainFrame>	m_pMainFrame;
	typedef saf::CComFramework safBaseClass;
};

extern CVisualStudioATLApp theApp;

